<template>
  <div class="topmain">
    <div class="updatetime">
      {{ main.updateTime }}
    </div>
    <div class="top">
      <div class="content">
        <div class="left">
          <img class="img" :src="main.now_img" />
        </div>
        <div class="right">
          <div class="tmp">{{ main.now_tmp }}</div>
          <div class="state">{{ main.now_state }}</div>
        </div>
      </div>
      <div class="text">{{ main.now_text }}</div>
    </div>
    <div class="bottom">
      <el-row>
        <el-col :xs="8" :sm="6" :md="4">
          <mainContent
            :content="main.now_windPower"
            :title="main.now_windDir"
          />
        </el-col>
        <el-col :xs="8" :sm="6" :md="4">
          <mainContent :content="main.now_humidity" title="相对湿度" />
        </el-col>
        <el-col :xs="8" :sm="6" :md="4">
          <mainContent :content="main.now_ultraviolet" title="紫外线" />
        </el-col>
        <el-col :xs="0" :sm="6" :md="4">
          <mainContent :content="main.now_bodytmp" title="体感温度" />
        </el-col>
        <el-col :xs="0" :sm="0" :md="4">
          <mainContent :content="main.now_see" title="能见度" />
        </el-col>
        <el-col :xs="0" :sm="0" :md="4">
          <mainContent :content="main.now_atmos" title="大气压" />
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script setup>
import mainContent from "@/components/main/main-content.vue";

const props = defineProps({
  main: {
    type: Object,
  },
});
</script>

<style lang="less" scoped>
.topmain {
  padding: 24px 30px;
  background-color: #e3eafe;
  border-radius: 30px;
  margin-bottom: 16px;
  .updatetime {
    font-size: 14px;
    line-height: 16px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.5);
    text-align: right;
  }
  .top {
    .content {
      display: flex;
      width: 100%;
      margin: 0 auto;
      .left {
        flex: 1;
        text-align: right;
        .img {
          width: 110px;
          height: 110px;
        }
      }
      .right {
        flex: 1;
        margin: auto 0;
        .tmp {
          font-size: 52px;
        }
        .state {
          font-size: 22px;
        }
      }
    }
    .text {
      text-align: center;
      margin: 26px auto 30px;
      max-width: 514px;
      min-height: 32px;
      font-size: 15px;
    }
  }
  .bottom {
    height: 84px;
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.1);
  }
}
</style>